﻿using Microsoft.Xna.Framework.Audio;
namespace XNAGameEngine.Audio
{
    public interface IManagerAudio2D
    {
        #region properties

        /// <summary>
        /// Get or set Song volume
        /// </summary>
        float _SongVolume { get; set; }

        /// <summary>
        /// Get or Set whether or not the playqueue should loop
        /// </summary>
        bool _IsLooping { get; set; }

        #endregion

        #region local methods

        /// <summary>
        /// This method will start the song queue if there are no songs currently playing
        /// </summary>
        void StartSong();

        /// <summary>
        /// This method adds a song to the queue for the MediaPlayer to play when there
        /// is not a specific song being played exclusively.
        /// </summary>
        /// <param name="songName">the name of the song to be added</param>
        void AddSongToQueue(string songName);

        /// <summary>
        /// Remove a song from the play queue
        /// </summary>
        /// <param name="songName">Song to be removed from the play queue</param>
        bool RemoveSongFromQueue(string songName);

        /// <summary>
        /// This method will play the next song in the play queue
        /// </summary>
        void NextSong();

        /// <summary>
        /// This method will play the previous song in the play queue
        /// </summary>
        void PreviousSong();

        /// <summary>
        /// This method will clear the contents of the play queue
        /// </summary>
        void ClearQueue();

        /// <summary>
        /// Play a song
        /// </summary>
        /// <param name="songName">the name of the song</param>
        /// <param name="looping">whether it loops or not</param>
        void PlaySong(string songName, bool looping);

        /// <summary>
        /// Play a song (no repeat)
        /// </summary>
        /// <param name="songName">the name of the song</param>
        void PlaySong(string songName);

        /// <summary>
        /// Pauses the song
        /// </summary>
        void PauseSong();

        /// <summary>
        /// Resumes the paused song
        /// </summary>
        void ResumeSong();

        /// <summary>
        /// Stops the song (no resume available)
        /// </summary>
        void StopSong();

        /// <summary>
        /// Restarts a song from beginning
        /// </summary>
        /// <param name="looping">whether the song loops</param>
        void RestartSong(bool looping);

        /// <summary>
        /// Restarts a song from the beginning (looping is unchanged from last play)
        /// </summary>
        void RestartSong();

        /// <summary>
        /// Plays a sound
        /// </summary>
        /// <param name="soundName">name of the sound</param>
        void PlaySound(string soundName);

        /// <summary>
        /// Plays a sound
        /// </summary>
        /// <param name="soundName">name of the sound</param>
        /// <param name="volume">volume (0.0f to 1.0f)</param>
        void PlaySound(string soundName, float volume);

        /// <summary>
        /// Plays a sound
        /// </summary>
        /// <param name="soundName">name of the sound</param>
        /// <param name="volume">volume (0.0f [mute] to 1.0f [maximum])</param>
        /// <param name="pitch">pitch (-1.0f [-1 octave] to 1.0f [+1 octave])</param>
        /// <param name="pan">pan (-1.0f [left] to 1.0f [right]. 0.0f is center</param>
        /// <param name="loop">whether the sound loops</param>
        SoundEffectInstance PlaySound(string soundName, float volume, float pitch, float pan, bool loop);

        /// <summary>
        /// This function handles stopping looped sound effects only.
        /// There is a check to insure that the sound effect is in the sound effect list before
        /// it adds it to the done list.
        /// </summary>
        /// <param name="soundToStop">a sound effect that was returned from the PlaySound function</param>
        void StopSoundEffect(SoundEffectInstance soundToStop);


        /// <summary>
        /// Stops song and all sounds
        /// </summary>
        void DestroySounds();

        #endregion
    }
}
